package rubik.crossover;

import rubik.ICubeSolution;

public class RandomCrossOver extends AbstractCrossOver{

private ICrossOverFunc[] _crossOvers;
	
	public RandomCrossOver () {
		this._crossOvers = new ICrossOverFunc[] { 
												new RandomSingleIndexCrossOver(),
												new RandomMargeCrossOver(),
												new ConcatenationCrossOver(),
												new CogwheelCrossOver()};
	}
	
	@Override
	public ICubeSolution applyCrossOver(ICubeSolution firstParent,
			ICubeSolution secondParent) {
		int r1 = r.nextInt(this._crossOvers.length);
		return this._crossOvers[r1].applyCrossOver(firstParent, secondParent);
	}

}
